package com.minjiang.blog.service.impl;

import com.minjiang.blog.mapper.UserDao;
import com.minjiang.blog.mode.User;
import com.minjiang.blog.service.UserService;
import com.minjiang.blog.util.MD5Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao userDao;

    /**
     * 发现注册用户
     * @param username
     * @param password
     * @return
     */
    @Override
    public User checkUser(String username, String password) {
        //密码加密
        User user = userDao.findByUsernameAndPassword(username,MD5Utils.md5password (password));
        return user;
    }
}
